package xin.yangshuai.leetcode01;

/**
 * Hello1
 *
 * @author shuai
 * @date 2022/6/8
 */
public class Hello1 {
    public static void main(String[] args) {
        Hello1 hello1 = new Hello1();
        String change = hello1.change(12345);
        System.out.println(change);
    }

    public String change(int num) {

        if (num == 0) {
            return "0";
        }

        String str = "";
        while (num > 0) {
            System.out.println("当前num->" + num);
            int more = num % 10;
            System.out.println("余数->" + more);
            num = num / 10;
            System.out.println("下一个num->" + num);
            str = str + more;
            System.out.println("存储的字符串->" + str);
        }

        return str;
    }
}
